{extend name="public:base"/}


{block name="title"}编辑店铺申请{/block}
{block name="style"}
<link href="__STATIC__/admin/plugin/my_uploader/css/uploads.css" rel="stylesheet">
{/block}

{block name="main"}

<section class="content" xmlns="http://www.w3.org/1999/html">
    <div class="row">

        <div class="col-md-12">

            <div class="row">
                <div class="col-lg-12">
                    <div class="box">
                        <div class="box-header with-border">
                            <h3 class="box-title">编辑店铺申请</h3>
                        </div>
                        <form  id="pt_form" method="post">
                            <div class="box-body">

                                <input type="hidden" name="apply_id" value="<?=$model['apply_id']?>" ?>
                                <div class="clearfix"></div>

          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="company_name" class="control-label Validform_label" >公司名称</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="company_name" class="form-control" name="company_name" placeholder="请输入公司名称" value="<?=$model['company_name']?>" datatype="s2-50" ignore="ignore"  errormsg="公司名称超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="province_id" class="control-label Validform_label" >所在地省市区</label>
                                    </div>
                                    <div class='col-sm-3'>
                                        <select name="province_id" onchange="getSelCity('#seleAreaThird',this)" class="form-control" >
                                            <option>请选择省</option>
                                            <?php foreach($province as $k=>$v){?>
                                                <option <?=$model['province_id'] == $v['id']?'selected="selected"':''?> value="<?=$v['id']?>"><?=$v['name']?></option>
                                            <?php }?>
                                        </select>
                                        <div class="help-block"></div>
                                    </div>
                                    <div class='col-sm-3'>
                                        <select name="city_id" id="seleAreaThird" onchange="getSelCity('#seleAreaFouth',this)" class="form-control" >
                                            <option>请选择市</option>
                                            <?php foreach($city as $k=>$v){?>
                                            <option <?=$model['city_id'] == $v['id']?'selected="selected"':''?> value="<?=$v['id']?>"><?=$v['name']?></option>
                                            <?php }?>
                                        </select>
                                        <div class="help-block"></div>
                                    </div>

                                    <div class='col-sm-3'>
                                        <select name="district_id" id="seleAreaFouth" class="form-control" >
                                            <option>请选择区</option>
                                            <?php foreach($district as $k=>$v){?>
                                            <option <?=$model['district_id'] == $v['id']?'selected="selected"':''?> value="<?=$v['id']?>"><?=$v['name']?></option>
                                            <?php }?>
                                        </select>
                                        <div class="help-block"></div>
                                    </div>
                                </div>

          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="address_detail" class="control-label Validform_label" >公司详细地址</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="address_detail" class="form-control" name="address_detail" placeholder="请输入公司详细地址" value="<?=$model['address_detail']?>" datatype="s2-50" ignore="ignore"  errormsg="公司详细地址超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="company_phone" class="control-label Validform_label" >公司电话</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="company_phone" class="form-control" name="company_phone" placeholder="请输入公司电话" value="<?=$model['company_phone']?>" datatype="s1-20" ignore="ignore">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="contacts_name" class="control-label Validform_label" >联系人姓名</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="contacts_name" class="form-control" name="contacts_name" placeholder="请输入联系人姓名" value="<?=$model['contacts_name']?>" datatype="s2-50" ignore="ignore"  errormsg="联系人姓名超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="contacts_phone" class="control-label Validform_label" >联系人电话</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="contacts_phone" class="form-control" name="contacts_phone" placeholder="请输入联系人电话" value="<?=$model['contacts_phone']?>" datatype="m" ignore="ignore" errormsg="请填写正确的手机号码">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="contacts_email" class="control-label Validform_label" >联系人邮箱</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="contacts_email" class="form-control" name="contacts_email" placeholder="请输入联系人邮箱" value="<?=$model['contacts_email']?>" datatype="e">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="contacts_card_no" class="control-label Validform_label" >申请人身份证号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="contacts_card_no" class="form-control" name="contacts_card_no" placeholder="请输入申请人身份证号" value="<?=$model['contacts_card_no']?>" datatype="s2-255" ignore="ignore"  errormsg="申请人身份证号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="contacts_card_electronic_1" class="control-label Validform_label" >申请人手持身份证电子版</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <div class="test">
                                            <div class="up-button" id="select-img">选择图片</div>
                                            <div class="img-list" id="img-list">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <?=showImage($model['contacts_card_electronic_1'],300,300)?>
                                                    <input type="hidden" name="contacts_card_electronic_1" value="<?=$model['contacts_card_electronic_1']?>"/>
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="contacts_card_electronic_2" class="control-label Validform_label" >申请人身份证正面</label>
                                    </div>
                                    <div class='col-sm-10'>

                                        <div class="test">
                                            <div class="up-button" id="select-img2">选择图片</div>
                                            <div class="img-list" id="img-list2">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <?=showImage($model['contacts_card_electronic_2'],300,300)?>
                                                    <input type="hidden" name="contacts_card_electronic_2" value="<?=$model['contacts_card_electronic_2']?>" />
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="contacts_card_electronic_3" class="control-label Validform_label" >申请人身份证反面</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <div class="test">
                                            <div class="up-button" id="select-img3">选择图片</div>
                                            <div class="img-list" id="img-list3">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <?=showImage($model['contacts_card_electronic_3'],300,300)?>         <input type="hidden" name="contacts_card_electronic_3" value="<?=$model['contacts_card_electronic_3']?>" />
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="business_licence_number" class="control-label Validform_label" >营业执照号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="business_licence_number" class="form-control" name="business_licence_number" placeholder="请输入营业执照号" value="<?=$model['business_licence_number']?>" datatype="s2-50" ignore="ignore"  errormsg="营业执照号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="company_employee_count" class="control-label Validform_label" >员工总数</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="company_employee_count" class="form-control" name="company_employee_count" placeholder="请输入员工总数" value="<?=$model['company_employee_count']?>" datatype="n" ignore="ignore"  errormsg="员工总数是数字类型">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="company_registered_capital" class="control-label Validform_label" >注册资金</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="company_registered_capital" class="form-control" name="company_registered_capital" placeholder="请输入注册资金" value="<?=$model['company_registered_capital']?>" datatype="n" ignore="ignore"  errormsg="注册资金是数字类型">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="business_sphere" class="control-label Validform_label" >法定经营范围</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="business_sphere" class="form-control" name="business_sphere" placeholder="请输入法定经营范围" value="<?=$model['business_sphere']?>" datatype="s2-1000" ignore="ignore"  errormsg="法定经营范围超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="business_licence_number_electronic" class="control-label Validform_label" >营业执照电子版</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <div class="test">
                                            <div class="up-button" id="select-img4">选择图片</div>
                                            <div class="img-list" id="img-list4">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <?=showImage($model['business_licence_number_electronic'],300,300)?>
                                                    <input type="hidden" name="business_licence_number_electronic" value="<?=$model['business_licence_number_electronic']?>">
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="organization_code" class="control-label Validform_label" >组织机构代码</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="organization_code" class="form-control" name="organization_code" placeholder="请输入组织机构代码" value="<?=$model['organization_code']?>" datatype="s2-50" ignore="ignore"  errormsg="组织机构代码超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="organization_code_electronic" class="control-label Validform_label" >组织机构代码电子版</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <div class="test">
                                            <div class="up-button" id="select-img5">选择图片</div>
                                            <div class="img-list" id="img-list5">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <?=showImage($model['organization_code_electronic'],300,300)?>
                                                    <input type="hidden" name="organization_code_electronic" value="<?=$model['organization_code_electronic']?>">
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="general_taxpayer" class="control-label Validform_label" >一般纳税人证明</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <div class="test">
                                            <div class="up-button" id="select-img6">选择图片</div>
                                            <div class="img-list" id="img-list6">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <?=showImage($model['general_taxpayer'],300,300)?>
                                                    <input type="hidden" name="general_taxpayer" value="<?=$model['general_taxpayer']?>">
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="bank_account_name" class="control-label Validform_label" >银行开户名</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="bank_account_name" class="form-control" name="bank_account_name" placeholder="请输入银行开户名" value="<?=$model['bank_account_name']?>" datatype="s2-50" ignore="ignore"  errormsg="银行开户名超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="bank_account_number" class="control-label Validform_label" >公司银行账号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="bank_account_number" class="form-control" name="bank_account_number" placeholder="请输入公司银行账号" value="<?=$model['bank_account_number']?>" datatype="s2-50" ignore="ignore"  errormsg="公司银行账号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="bank_name" class="control-label Validform_label" >开户银行支行名称</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="bank_name" class="form-control" name="bank_name" placeholder="请输入开户银行支行名称" value="<?=$model['bank_name']?>" datatype="s2-50" ignore="ignore"  errormsg="开户银行支行名称超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="bank_code" class="control-label Validform_label" >支行联行号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="bank_code" class="form-control" name="bank_code" placeholder="请输入支行联行号" value="<?=$model['bank_code']?>" datatype="s2-50" ignore="ignore"  errormsg="支行联行号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="bank_address" class="control-label Validform_label" >开户银行所在地</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="bank_address" class="form-control" name="bank_address" placeholder="请输入开户银行所在地" value="<?=$model['bank_address']?>" datatype="s2-50" ignore="ignore"  errormsg="开户银行所在地超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

                                <div class="form-group required">
                                    <div class="col-sm-2 text-right">
                                        <label class="control-label Validform_label">开户行账号是否为结算账号                                         </label>
                                    </div>

                                    <div class="col-sm-10">
                                        <div>
                                            <span style="color:#636f7a"><input type="radio" name="is_settlement_account" value="0" datatype="*" <?=$model['is_settlement_account']==0?'checked="checked"':''?> nullmsg="请选择开户行账号是否为结算账号">否</span>

                                            <span style="color:#636f7a"><input type="radio" name="is_settlement_account" value="1" <?=$model['is_settlement_account']==1?'checked="checked"':''?>>是</span>
                                        </div>
                                        <div class="help-block"></div>
                                    </div>
                                </div>


     
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="settlement_bank_account_name" class="control-label Validform_label" >结算银行开户名</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="settlement_bank_account_name" class="form-control" name="settlement_bank_account_name" placeholder="请输入结算银行开户名" value="<?=$model['settlement_bank_account_name']?>" datatype="s2-50" ignore="ignore"  errormsg="结算银行开户名超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="settlement_bank_account_number" class="control-label Validform_label" >结算公司银行账号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="settlement_bank_account_number" class="form-control" name="settlement_bank_account_number" placeholder="请输入结算公司银行账号" value="<?=$model['settlement_bank_account_number']?>" datatype="s2-50" ignore="ignore"  errormsg="结算公司银行账号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="settlement_bank_name" class="control-label Validform_label" >结算开户银行支行名称</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="settlement_bank_name" class="form-control" name="settlement_bank_name" placeholder="请输入结算开户银行支行名称" value="<?=$model['settlement_bank_name']?>" datatype="s2-50" ignore="ignore"  errormsg="结算开户银行支行名称超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="settlement_bank_code" class="control-label Validform_label" >结算支行联行号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="settlement_bank_code" class="form-control" name="settlement_bank_code" placeholder="请输入结算支行联行号" value="<?=$model['settlement_bank_code']?>" datatype="s2-50" ignore="ignore"  errormsg="结算支行联行号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="settlement_bank_address" class="control-label Validform_label" >结算开户银行所在地</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="settlement_bank_address" class="form-control" name="settlement_bank_address" placeholder="请输入结算开户银行所在地" value="<?=$model['settlement_bank_address']?>" datatype="s2-50" ignore="ignore"  errormsg="结算开户银行所在地超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="tax_registration_certificate" class="control-label Validform_label" >税务登记证号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="tax_registration_certificate" class="form-control" name="tax_registration_certificate" placeholder="请输入税务登记证号" value="<?=$model['tax_registration_certificate']?>" datatype="s2-50" ignore="ignore"  errormsg="税务登记证号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          

                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="taxpayer_id" class="control-label Validform_label" >纳税人识别号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="taxpayer_id" class="form-control" name="taxpayer_id" placeholder="请输入纳税人识别号" value="<?=$model['taxpayer_id']?>" datatype="s2-50" ignore="ignore"  errormsg="纳税人识别号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>


                            </div>
                            <div class="box-footer text-center">
                                <button class="btn btn-primary" type="submit">保存</button>
                                <span class="btn btn-white" onclick="history.go(-1)">返回</span>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
{/block}

{block name="js"}
<script src="__STATIC__/admin/plugin/my_uploader/js/uploads.js"></script>
<script>

    var validate = validator('#pt_form',"<?=url('admin/Shop/index')?>");
    $('#select-img').click(function(){
        uploader.open({
            elm:'select-img',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'member/'.$model['member_id']])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list',//存放选择图片之后的容器
            input_name:'contacts_card_electronic_1',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });

    $('#select-img2').click(function(){
        uploader.open({
            elm:'select-img2',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'member/'.$model['member_id']])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list2',//存放选择图片之后的容器
            input_name:'contacts_card_electronic_2',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });

    $('#select-img3').click(function(){
        uploader.open({
            elm:'select-img3',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'member/'.$model['member_id']])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list3',//存放选择图片之后的容器
            input_name:'contacts_card_electronic_3',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });

    $('#select-img4').click(function(){
        uploader.open({
            elm:'select-img4',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'member/'.$model['member_id']])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list4',//存放选择图片之后的容器
            input_name:'business_licence_number_electronic',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });

    $('#select-img5').click(function(){
        uploader.open({
            elm:'select-img5',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'member/'.$model['member_id']])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list5',//存放选择图片之后的容器
            input_name:'organization_code_electronic',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });

    $('#select-img6').click(function(){
        uploader.open({
            elm:'select-img6',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'member/'.$model['member_id']])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list6',//存放选择图片之后的容器
            input_name:'general_taxpayer',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });

</script>
<script>
    function getSelCity(htmlObj,obj){
        let id = $(obj).val();
        if(!id){
            return false;
        }
        $.ajax({
            url:"<?=url('common/AjaxController/ajaxGetProvince')->suffix(false)?>/id/"+id,
            type:'get',
            dataType:'json',
            success:function(res){
                let str = '';
                $(res).each(function(k,v){
                    str += '<option value="'+v.id+'">'+v.name+'</option>';
                });
                $(htmlObj).html(str);
            },
            error:function(res){
            }
        });
    }
</script>
{/block}